﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using Pharmacy.Entities;
using Pharmacy.Data;

#endregion

namespace Pharmacy.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="DrugDispoProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class DrugDispoProviderBaseCore : EntityProviderBase<Pharmacy.Entities.DrugDispo, Pharmacy.Entities.DrugDispoKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, Pharmacy.Entities.DrugDispoKey key)
		{
			return Delete(transactionManager, key.DrugId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_drugId">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.String _drugId)
		{
			return Delete(null, _drugId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_drugId">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.String _drugId);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Classification key.
		///		FK_DrugDispo_Classification Description: 
		/// </summary>
		/// <param name="_classificationId"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByClassificationId(System.Int32? _classificationId)
		{
			int count = -1;
			return GetByClassificationId(_classificationId, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Classification key.
		///		FK_DrugDispo_Classification Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_classificationId"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		/// <remarks></remarks>
		public TList<DrugDispo> GetByClassificationId(TransactionManager transactionManager, System.Int32? _classificationId)
		{
			int count = -1;
			return GetByClassificationId(transactionManager, _classificationId, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Classification key.
		///		FK_DrugDispo_Classification Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_classificationId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByClassificationId(TransactionManager transactionManager, System.Int32? _classificationId, int start, int pageLength)
		{
			int count = -1;
			return GetByClassificationId(transactionManager, _classificationId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Classification key.
		///		fkDrugDispoClassification Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_classificationId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByClassificationId(System.Int32? _classificationId, int start, int pageLength)
		{
			int count =  -1;
			return GetByClassificationId(null, _classificationId, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Classification key.
		///		fkDrugDispoClassification Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_classificationId"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByClassificationId(System.Int32? _classificationId, int start, int pageLength,out int count)
		{
			return GetByClassificationId(null, _classificationId, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Classification key.
		///		FK_DrugDispo_Classification Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_classificationId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public abstract TList<DrugDispo> GetByClassificationId(TransactionManager transactionManager, System.Int32? _classificationId, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Group key.
		///		FK_DrugDispo_Group Description: 
		/// </summary>
		/// <param name="_groupId"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByGroupId(System.Int32? _groupId)
		{
			int count = -1;
			return GetByGroupId(_groupId, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Group key.
		///		FK_DrugDispo_Group Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_groupId"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		/// <remarks></remarks>
		public TList<DrugDispo> GetByGroupId(TransactionManager transactionManager, System.Int32? _groupId)
		{
			int count = -1;
			return GetByGroupId(transactionManager, _groupId, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Group key.
		///		FK_DrugDispo_Group Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_groupId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByGroupId(TransactionManager transactionManager, System.Int32? _groupId, int start, int pageLength)
		{
			int count = -1;
			return GetByGroupId(transactionManager, _groupId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Group key.
		///		fkDrugDispoGroup Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_groupId"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByGroupId(System.Int32? _groupId, int start, int pageLength)
		{
			int count =  -1;
			return GetByGroupId(null, _groupId, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Group key.
		///		fkDrugDispoGroup Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_groupId"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByGroupId(System.Int32? _groupId, int start, int pageLength,out int count)
		{
			return GetByGroupId(null, _groupId, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Group key.
		///		FK_DrugDispo_Group Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_groupId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public abstract TList<DrugDispo> GetByGroupId(TransactionManager transactionManager, System.Int32? _groupId, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_MarkUpType key.
		///		FK_DrugDispo_MarkUpType Description: 
		/// </summary>
		/// <param name="_markUpType"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByMarkUpType(System.Int32? _markUpType)
		{
			int count = -1;
			return GetByMarkUpType(_markUpType, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_MarkUpType key.
		///		FK_DrugDispo_MarkUpType Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_markUpType"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		/// <remarks></remarks>
		public TList<DrugDispo> GetByMarkUpType(TransactionManager transactionManager, System.Int32? _markUpType)
		{
			int count = -1;
			return GetByMarkUpType(transactionManager, _markUpType, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_MarkUpType key.
		///		FK_DrugDispo_MarkUpType Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_markUpType"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByMarkUpType(TransactionManager transactionManager, System.Int32? _markUpType, int start, int pageLength)
		{
			int count = -1;
			return GetByMarkUpType(transactionManager, _markUpType, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_MarkUpType key.
		///		fkDrugDispoMarkUpType Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_markUpType"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByMarkUpType(System.Int32? _markUpType, int start, int pageLength)
		{
			int count =  -1;
			return GetByMarkUpType(null, _markUpType, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_MarkUpType key.
		///		fkDrugDispoMarkUpType Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_markUpType"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByMarkUpType(System.Int32? _markUpType, int start, int pageLength,out int count)
		{
			return GetByMarkUpType(null, _markUpType, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_MarkUpType key.
		///		FK_DrugDispo_MarkUpType Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_markUpType"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public abstract TList<DrugDispo> GetByMarkUpType(TransactionManager transactionManager, System.Int32? _markUpType, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Shelf key.
		///		FK_DrugDispo_Shelf Description: 
		/// </summary>
		/// <param name="_shelf"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByShelf(System.String _shelf)
		{
			int count = -1;
			return GetByShelf(_shelf, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Shelf key.
		///		FK_DrugDispo_Shelf Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_shelf"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		/// <remarks></remarks>
		public TList<DrugDispo> GetByShelf(TransactionManager transactionManager, System.String _shelf)
		{
			int count = -1;
			return GetByShelf(transactionManager, _shelf, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Shelf key.
		///		FK_DrugDispo_Shelf Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_shelf"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByShelf(TransactionManager transactionManager, System.String _shelf, int start, int pageLength)
		{
			int count = -1;
			return GetByShelf(transactionManager, _shelf, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Shelf key.
		///		fkDrugDispoShelf Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_shelf"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByShelf(System.String _shelf, int start, int pageLength)
		{
			int count =  -1;
			return GetByShelf(null, _shelf, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Shelf key.
		///		fkDrugDispoShelf Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_shelf"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByShelf(System.String _shelf, int start, int pageLength,out int count)
		{
			return GetByShelf(null, _shelf, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_Shelf key.
		///		FK_DrugDispo_Shelf Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_shelf"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public abstract TList<DrugDispo> GetByShelf(TransactionManager transactionManager, System.String _shelf, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_UnitTable key.
		///		FK_DrugDispo_UnitTable Description: 
		/// </summary>
		/// <param name="_unit"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByUnit(System.String _unit)
		{
			int count = -1;
			return GetByUnit(_unit, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_UnitTable key.
		///		FK_DrugDispo_UnitTable Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_unit"></param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		/// <remarks></remarks>
		public TList<DrugDispo> GetByUnit(TransactionManager transactionManager, System.String _unit)
		{
			int count = -1;
			return GetByUnit(transactionManager, _unit, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_UnitTable key.
		///		FK_DrugDispo_UnitTable Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_unit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByUnit(TransactionManager transactionManager, System.String _unit, int start, int pageLength)
		{
			int count = -1;
			return GetByUnit(transactionManager, _unit, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_UnitTable key.
		///		fkDrugDispoUnitTable Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_unit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByUnit(System.String _unit, int start, int pageLength)
		{
			int count =  -1;
			return GetByUnit(null, _unit, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_UnitTable key.
		///		fkDrugDispoUnitTable Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_unit"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public TList<DrugDispo> GetByUnit(System.String _unit, int start, int pageLength,out int count)
		{
			return GetByUnit(null, _unit, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DrugDispo_UnitTable key.
		///		FK_DrugDispo_UnitTable Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_unit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of Pharmacy.Entities.DrugDispo objects.</returns>
		public abstract TList<DrugDispo> GetByUnit(TransactionManager transactionManager, System.String _unit, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override Pharmacy.Entities.DrugDispo Get(TransactionManager transactionManager, Pharmacy.Entities.DrugDispoKey key, int start, int pageLength)
		{
			return GetByDrugId(transactionManager, key.DrugId, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_DrugDispo index.
		/// </summary>
		/// <param name="_drugId"></param>
		/// <returns>Returns an instance of the <see cref="Pharmacy.Entities.DrugDispo"/> class.</returns>
		public Pharmacy.Entities.DrugDispo GetByDrugId(System.String _drugId)
		{
			int count = -1;
			return GetByDrugId(null,_drugId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DrugDispo index.
		/// </summary>
		/// <param name="_drugId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="Pharmacy.Entities.DrugDispo"/> class.</returns>
		public Pharmacy.Entities.DrugDispo GetByDrugId(System.String _drugId, int start, int pageLength)
		{
			int count = -1;
			return GetByDrugId(null, _drugId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DrugDispo index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_drugId"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="Pharmacy.Entities.DrugDispo"/> class.</returns>
		public Pharmacy.Entities.DrugDispo GetByDrugId(TransactionManager transactionManager, System.String _drugId)
		{
			int count = -1;
			return GetByDrugId(transactionManager, _drugId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DrugDispo index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_drugId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="Pharmacy.Entities.DrugDispo"/> class.</returns>
		public Pharmacy.Entities.DrugDispo GetByDrugId(TransactionManager transactionManager, System.String _drugId, int start, int pageLength)
		{
			int count = -1;
			return GetByDrugId(transactionManager, _drugId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DrugDispo index.
		/// </summary>
		/// <param name="_drugId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="Pharmacy.Entities.DrugDispo"/> class.</returns>
		public Pharmacy.Entities.DrugDispo GetByDrugId(System.String _drugId, int start, int pageLength, out int count)
		{
			return GetByDrugId(null, _drugId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DrugDispo index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_drugId"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="Pharmacy.Entities.DrugDispo"/> class.</returns>
		public abstract Pharmacy.Entities.DrugDispo GetByDrugId(TransactionManager transactionManager, System.String _drugId, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#region _DrugDispo_ReplaceCode 
		
		/// <summary>
		///	This method wrap the '_DrugDispo_ReplaceCode' stored procedure. 
		/// </summary>
		/// <param name="newDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="oldDrugId"> A <c>System.String</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		public void ReplaceCode(System.String newDrugId, System.String oldDrugId)
		{
			 ReplaceCode(null, 0, int.MaxValue , newDrugId, oldDrugId);
		}
		
		/// <summary>
		///	This method wrap the '_DrugDispo_ReplaceCode' stored procedure. 
		/// </summary>
		/// <param name="newDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="oldDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		public void ReplaceCode(int start, int pageLength, System.String newDrugId, System.String oldDrugId)
		{
			 ReplaceCode(null, start, pageLength , newDrugId, oldDrugId);
		}
				
		/// <summary>
		///	This method wrap the '_DrugDispo_ReplaceCode' stored procedure. 
		/// </summary>
		/// <param name="newDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="oldDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		public void ReplaceCode(TransactionManager transactionManager, System.String newDrugId, System.String oldDrugId)
		{
			 ReplaceCode(transactionManager, 0, int.MaxValue , newDrugId, oldDrugId);
		}
		
		/// <summary>
		///	This method wrap the '_DrugDispo_ReplaceCode' stored procedure. 
		/// </summary>
		/// <param name="newDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="oldDrugId"> A <c>System.String</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		public abstract void ReplaceCode(TransactionManager transactionManager, int start, int pageLength , System.String newDrugId, System.String oldDrugId);
		
		#endregion
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;DrugDispo&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;DrugDispo&gt;"/></returns>
		public static TList<DrugDispo> Fill(IDataReader reader, TList<DrugDispo> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				Pharmacy.Entities.DrugDispo c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("DrugDispo")
					.Append("|").Append((System.String)reader[((int)DrugDispoColumn.DrugId - 1)]).ToString();
					c = EntityManager.LocateOrCreate<DrugDispo>(
					key.ToString(), // EntityTrackingKey
					"DrugDispo",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new Pharmacy.Entities.DrugDispo();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.DrugId = (System.String)reader[((int)DrugDispoColumn.DrugId - 1)];
					c.OriginalDrugId = c.DrugId;
					c.DrugName = (System.String)reader[((int)DrugDispoColumn.DrugName - 1)];
					c.GenericName = (reader.IsDBNull(((int)DrugDispoColumn.GenericName - 1)))?null:(System.String)reader[((int)DrugDispoColumn.GenericName - 1)];
					c.Specification = (reader.IsDBNull(((int)DrugDispoColumn.Specification - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Specification - 1)];
					c.Unit = (System.String)reader[((int)DrugDispoColumn.Unit - 1)];
					c.MarkUpType = (reader.IsDBNull(((int)DrugDispoColumn.MarkUpType - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.MarkUpType - 1)];
					c.CostPrice = (System.Decimal)reader[((int)DrugDispoColumn.CostPrice - 1)];
					c.SellPrice = (System.Decimal)reader[((int)DrugDispoColumn.SellPrice - 1)];
					c.ValidPeriod = (reader.IsDBNull(((int)DrugDispoColumn.ValidPeriod - 1)))?null:(System.DateTime?)reader[((int)DrugDispoColumn.ValidPeriod - 1)];
					c.MinStock = (reader.IsDBNull(((int)DrugDispoColumn.MinStock - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.MinStock - 1)];
					c.MaxStock = (reader.IsDBNull(((int)DrugDispoColumn.MaxStock - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.MaxStock - 1)];
					c.Shelf = (reader.IsDBNull(((int)DrugDispoColumn.Shelf - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Shelf - 1)];
					c.GroupId = (reader.IsDBNull(((int)DrugDispoColumn.GroupId - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.GroupId - 1)];
					c.ClassificationId = (reader.IsDBNull(((int)DrugDispoColumn.ClassificationId - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.ClassificationId - 1)];
					c.UseGuide = (reader.IsDBNull(((int)DrugDispoColumn.UseGuide - 1)))?null:(System.String)reader[((int)DrugDispoColumn.UseGuide - 1)];
					c.Precaution = (reader.IsDBNull(((int)DrugDispoColumn.Precaution - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Precaution - 1)];
					c.Package = (reader.IsDBNull(((int)DrugDispoColumn.Package - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Package - 1)];
					c.IsControlDrug = (System.Boolean)reader[((int)DrugDispoColumn.IsControlDrug - 1)];
					c.Remark = (reader.IsDBNull(((int)DrugDispoColumn.Remark - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Remark - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="Pharmacy.Entities.DrugDispo"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="Pharmacy.Entities.DrugDispo"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, Pharmacy.Entities.DrugDispo entity)
		{
			if (!reader.Read()) return;
			
			entity.DrugId = (System.String)reader[((int)DrugDispoColumn.DrugId - 1)];
			entity.OriginalDrugId = (System.String)reader["DrugId"];
			entity.DrugName = (System.String)reader[((int)DrugDispoColumn.DrugName - 1)];
			entity.GenericName = (reader.IsDBNull(((int)DrugDispoColumn.GenericName - 1)))?null:(System.String)reader[((int)DrugDispoColumn.GenericName - 1)];
			entity.Specification = (reader.IsDBNull(((int)DrugDispoColumn.Specification - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Specification - 1)];
			entity.Unit = (System.String)reader[((int)DrugDispoColumn.Unit - 1)];
			entity.MarkUpType = (reader.IsDBNull(((int)DrugDispoColumn.MarkUpType - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.MarkUpType - 1)];
			entity.CostPrice = (System.Decimal)reader[((int)DrugDispoColumn.CostPrice - 1)];
			entity.SellPrice = (System.Decimal)reader[((int)DrugDispoColumn.SellPrice - 1)];
			entity.ValidPeriod = (reader.IsDBNull(((int)DrugDispoColumn.ValidPeriod - 1)))?null:(System.DateTime?)reader[((int)DrugDispoColumn.ValidPeriod - 1)];
			entity.MinStock = (reader.IsDBNull(((int)DrugDispoColumn.MinStock - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.MinStock - 1)];
			entity.MaxStock = (reader.IsDBNull(((int)DrugDispoColumn.MaxStock - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.MaxStock - 1)];
			entity.Shelf = (reader.IsDBNull(((int)DrugDispoColumn.Shelf - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Shelf - 1)];
			entity.GroupId = (reader.IsDBNull(((int)DrugDispoColumn.GroupId - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.GroupId - 1)];
			entity.ClassificationId = (reader.IsDBNull(((int)DrugDispoColumn.ClassificationId - 1)))?null:(System.Int32?)reader[((int)DrugDispoColumn.ClassificationId - 1)];
			entity.UseGuide = (reader.IsDBNull(((int)DrugDispoColumn.UseGuide - 1)))?null:(System.String)reader[((int)DrugDispoColumn.UseGuide - 1)];
			entity.Precaution = (reader.IsDBNull(((int)DrugDispoColumn.Precaution - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Precaution - 1)];
			entity.Package = (reader.IsDBNull(((int)DrugDispoColumn.Package - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Package - 1)];
			entity.IsControlDrug = (System.Boolean)reader[((int)DrugDispoColumn.IsControlDrug - 1)];
			entity.Remark = (reader.IsDBNull(((int)DrugDispoColumn.Remark - 1)))?null:(System.String)reader[((int)DrugDispoColumn.Remark - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="Pharmacy.Entities.DrugDispo"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="Pharmacy.Entities.DrugDispo"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, Pharmacy.Entities.DrugDispo entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.DrugId = (System.String)dataRow["DrugId"];
			entity.OriginalDrugId = (System.String)dataRow["DrugId"];
			entity.DrugName = (System.String)dataRow["DrugName"];
			entity.GenericName = Convert.IsDBNull(dataRow["GenericName"]) ? null : (System.String)dataRow["GenericName"];
			entity.Specification = Convert.IsDBNull(dataRow["Specification"]) ? null : (System.String)dataRow["Specification"];
			entity.Unit = (System.String)dataRow["Unit"];
			entity.MarkUpType = Convert.IsDBNull(dataRow["MarkUpType"]) ? null : (System.Int32?)dataRow["MarkUpType"];
			entity.CostPrice = (System.Decimal)dataRow["CostPrice"];
			entity.SellPrice = (System.Decimal)dataRow["SellPrice"];
			entity.ValidPeriod = Convert.IsDBNull(dataRow["ValidPeriod"]) ? null : (System.DateTime?)dataRow["ValidPeriod"];
			entity.MinStock = Convert.IsDBNull(dataRow["MinStock"]) ? null : (System.Int32?)dataRow["MinStock"];
			entity.MaxStock = Convert.IsDBNull(dataRow["MaxStock"]) ? null : (System.Int32?)dataRow["MaxStock"];
			entity.Shelf = Convert.IsDBNull(dataRow["Shelf"]) ? null : (System.String)dataRow["Shelf"];
			entity.GroupId = Convert.IsDBNull(dataRow["GroupId"]) ? null : (System.Int32?)dataRow["GroupId"];
			entity.ClassificationId = Convert.IsDBNull(dataRow["ClassificationId"]) ? null : (System.Int32?)dataRow["ClassificationId"];
			entity.UseGuide = Convert.IsDBNull(dataRow["UseGuide"]) ? null : (System.String)dataRow["UseGuide"];
			entity.Precaution = Convert.IsDBNull(dataRow["Precaution"]) ? null : (System.String)dataRow["Precaution"];
			entity.Package = Convert.IsDBNull(dataRow["Package"]) ? null : (System.String)dataRow["Package"];
			entity.IsControlDrug = (System.Boolean)dataRow["IsControlDrug"];
			entity.Remark = Convert.IsDBNull(dataRow["Remark"]) ? null : (System.String)dataRow["Remark"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="Pharmacy.Entities.DrugDispo"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">Pharmacy.Entities.DrugDispo Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, Pharmacy.Entities.DrugDispo entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region ClassificationIdSource	
			if (CanDeepLoad(entity, "Classification|ClassificationIdSource", deepLoadType, innerList) 
				&& entity.ClassificationIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ClassificationId ?? (int)0);
				Classification tmpEntity = EntityManager.LocateEntity<Classification>(EntityLocator.ConstructKeyFromPkItems(typeof(Classification), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ClassificationIdSource = tmpEntity;
				else
					entity.ClassificationIdSource = DataRepository.ClassificationProvider.GetByClassificationId(transactionManager, (entity.ClassificationId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ClassificationIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ClassificationIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.ClassificationProvider.DeepLoad(transactionManager, entity.ClassificationIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ClassificationIdSource

			#region GroupIdSource	
			if (CanDeepLoad(entity, "Group|GroupIdSource", deepLoadType, innerList) 
				&& entity.GroupIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.GroupId ?? (int)0);
				Group tmpEntity = EntityManager.LocateEntity<Group>(EntityLocator.ConstructKeyFromPkItems(typeof(Group), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.GroupIdSource = tmpEntity;
				else
					entity.GroupIdSource = DataRepository.GroupProvider.GetByGroupId(transactionManager, (entity.GroupId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GroupIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GroupIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.GroupProvider.DeepLoad(transactionManager, entity.GroupIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion GroupIdSource

			#region MarkUpTypeSource	
			if (CanDeepLoad(entity, "MarkUpType|MarkUpTypeSource", deepLoadType, innerList) 
				&& entity.MarkUpTypeSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.MarkUpType ?? (int)0);
				MarkUpType tmpEntity = EntityManager.LocateEntity<MarkUpType>(EntityLocator.ConstructKeyFromPkItems(typeof(MarkUpType), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.MarkUpTypeSource = tmpEntity;
				else
					entity.MarkUpTypeSource = DataRepository.MarkUpTypeProvider.GetByMarkUpType(transactionManager, (entity.MarkUpType ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'MarkUpTypeSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.MarkUpTypeSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.MarkUpTypeProvider.DeepLoad(transactionManager, entity.MarkUpTypeSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion MarkUpTypeSource

			#region ShelfSource	
			if (CanDeepLoad(entity, "Shelf|ShelfSource", deepLoadType, innerList) 
				&& entity.ShelfSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.Shelf ?? string.Empty);
				Shelf tmpEntity = EntityManager.LocateEntity<Shelf>(EntityLocator.ConstructKeyFromPkItems(typeof(Shelf), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ShelfSource = tmpEntity;
				else
					entity.ShelfSource = DataRepository.ShelfProvider.GetByShelf(transactionManager, (entity.Shelf ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ShelfSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ShelfSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.ShelfProvider.DeepLoad(transactionManager, entity.ShelfSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ShelfSource

			#region UnitSource	
			if (CanDeepLoad(entity, "UnitTable|UnitSource", deepLoadType, innerList) 
				&& entity.UnitSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.Unit;
				UnitTable tmpEntity = EntityManager.LocateEntity<UnitTable>(EntityLocator.ConstructKeyFromPkItems(typeof(UnitTable), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.UnitSource = tmpEntity;
				else
					entity.UnitSource = DataRepository.UnitTableProvider.GetByUnit(transactionManager, entity.Unit);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'UnitSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.UnitSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.UnitTableProvider.DeepLoad(transactionManager, entity.UnitSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion UnitSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByDrugId methods when available
			
			#region AdjustmentDetailsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<AdjustmentDetails>|AdjustmentDetailsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'AdjustmentDetailsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.AdjustmentDetailsCollection = DataRepository.AdjustmentDetailsProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.AdjustmentDetailsCollection.Count > 0)
				{
					deepHandles.Add("AdjustmentDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<AdjustmentDetails>) DataRepository.AdjustmentDetailsProvider.DeepLoad,
						new object[] { transactionManager, entity.AdjustmentDetailsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region RequiredAdjustmentCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<RequiredAdjustment>|RequiredAdjustmentCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'RequiredAdjustmentCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.RequiredAdjustmentCollection = DataRepository.RequiredAdjustmentProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.RequiredAdjustmentCollection.Count > 0)
				{
					deepHandles.Add("RequiredAdjustmentCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<RequiredAdjustment>) DataRepository.RequiredAdjustmentProvider.DeepLoad,
						new object[] { transactionManager, entity.RequiredAdjustmentCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PrescriptionDetailCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PrescriptionDetail>|PrescriptionDetailCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PrescriptionDetailCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PrescriptionDetailCollection = DataRepository.PrescriptionDetailProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.PrescriptionDetailCollection.Count > 0)
				{
					deepHandles.Add("PrescriptionDetailCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PrescriptionDetail>) DataRepository.PrescriptionDetailProvider.DeepLoad,
						new object[] { transactionManager, entity.PrescriptionDetailCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region DrugDiscountCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<DrugDiscount>|DrugDiscountCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DrugDiscountCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.DrugDiscountCollection = DataRepository.DrugDiscountProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.DrugDiscountCollection.Count > 0)
				{
					deepHandles.Add("DrugDiscountCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<DrugDiscount>) DataRepository.DrugDiscountProvider.DeepLoad,
						new object[] { transactionManager, entity.DrugDiscountCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region GrnDetailsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<GrnDetails>|GrnDetailsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GrnDetailsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.GrnDetailsCollection = DataRepository.GrnDetailsProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.GrnDetailsCollection.Count > 0)
				{
					deepHandles.Add("GrnDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<GrnDetails>) DataRepository.GrnDetailsProvider.DeepLoad,
						new object[] { transactionManager, entity.GrnDetailsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region PoDetailsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<PoDetails>|PoDetailsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PoDetailsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.PoDetailsCollection = DataRepository.PoDetailsProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.PoDetailsCollection.Count > 0)
				{
					deepHandles.Add("PoDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<PoDetails>) DataRepository.PoDetailsProvider.DeepLoad,
						new object[] { transactionManager, entity.PoDetailsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region StockCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<Stock>|StockCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StockCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.StockCollection = DataRepository.StockProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.StockCollection.Count > 0)
				{
					deepHandles.Add("StockCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<Stock>) DataRepository.StockProvider.DeepLoad,
						new object[] { transactionManager, entity.StockCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region StockOutDetailsCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<StockOutDetails>|StockOutDetailsCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StockOutDetailsCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.StockOutDetailsCollection = DataRepository.StockOutDetailsProvider.GetByDrugId(transactionManager, entity.DrugId);

				if (deep && entity.StockOutDetailsCollection.Count > 0)
				{
					deepHandles.Add("StockOutDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<StockOutDetails>) DataRepository.StockOutDetailsProvider.DeepLoad,
						new object[] { transactionManager, entity.StockOutDetailsCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the Pharmacy.Entities.DrugDispo object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">Pharmacy.Entities.DrugDispo instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">Pharmacy.Entities.DrugDispo Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, Pharmacy.Entities.DrugDispo entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region ClassificationIdSource
			if (CanDeepSave(entity, "Classification|ClassificationIdSource", deepSaveType, innerList) 
				&& entity.ClassificationIdSource != null)
			{
				DataRepository.ClassificationProvider.Save(transactionManager, entity.ClassificationIdSource);
				entity.ClassificationId = entity.ClassificationIdSource.ClassificationId;
			}
			#endregion 
			
			#region GroupIdSource
			if (CanDeepSave(entity, "Group|GroupIdSource", deepSaveType, innerList) 
				&& entity.GroupIdSource != null)
			{
				DataRepository.GroupProvider.Save(transactionManager, entity.GroupIdSource);
				entity.GroupId = entity.GroupIdSource.GroupId;
			}
			#endregion 
			
			#region MarkUpTypeSource
			if (CanDeepSave(entity, "MarkUpType|MarkUpTypeSource", deepSaveType, innerList) 
				&& entity.MarkUpTypeSource != null)
			{
				DataRepository.MarkUpTypeProvider.Save(transactionManager, entity.MarkUpTypeSource);
				entity.MarkUpType = entity.MarkUpTypeSource.MarkUpType;
			}
			#endregion 
			
			#region ShelfSource
			if (CanDeepSave(entity, "Shelf|ShelfSource", deepSaveType, innerList) 
				&& entity.ShelfSource != null)
			{
				DataRepository.ShelfProvider.Save(transactionManager, entity.ShelfSource);
				entity.Shelf = entity.ShelfSource.Shelf;
			}
			#endregion 
			
			#region UnitSource
			if (CanDeepSave(entity, "UnitTable|UnitSource", deepSaveType, innerList) 
				&& entity.UnitSource != null)
			{
				DataRepository.UnitTableProvider.Save(transactionManager, entity.UnitSource);
				entity.Unit = entity.UnitSource.Unit;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
	
			#region List<AdjustmentDetails>
				if (CanDeepSave(entity.AdjustmentDetailsCollection, "List<AdjustmentDetails>|AdjustmentDetailsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(AdjustmentDetails child in entity.AdjustmentDetailsCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.AdjustmentDetailsCollection.Count > 0 || entity.AdjustmentDetailsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.AdjustmentDetailsProvider.Save(transactionManager, entity.AdjustmentDetailsCollection);
						
						deepHandles.Add("AdjustmentDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< AdjustmentDetails >) DataRepository.AdjustmentDetailsProvider.DeepSave,
							new object[] { transactionManager, entity.AdjustmentDetailsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<RequiredAdjustment>
				if (CanDeepSave(entity.RequiredAdjustmentCollection, "List<RequiredAdjustment>|RequiredAdjustmentCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(RequiredAdjustment child in entity.RequiredAdjustmentCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.RequiredAdjustmentCollection.Count > 0 || entity.RequiredAdjustmentCollection.DeletedItems.Count > 0)
					{
						//DataRepository.RequiredAdjustmentProvider.Save(transactionManager, entity.RequiredAdjustmentCollection);
						
						deepHandles.Add("RequiredAdjustmentCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< RequiredAdjustment >) DataRepository.RequiredAdjustmentProvider.DeepSave,
							new object[] { transactionManager, entity.RequiredAdjustmentCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PrescriptionDetail>
				if (CanDeepSave(entity.PrescriptionDetailCollection, "List<PrescriptionDetail>|PrescriptionDetailCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PrescriptionDetail child in entity.PrescriptionDetailCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.PrescriptionDetailCollection.Count > 0 || entity.PrescriptionDetailCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PrescriptionDetailProvider.Save(transactionManager, entity.PrescriptionDetailCollection);
						
						deepHandles.Add("PrescriptionDetailCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PrescriptionDetail >) DataRepository.PrescriptionDetailProvider.DeepSave,
							new object[] { transactionManager, entity.PrescriptionDetailCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<DrugDiscount>
				if (CanDeepSave(entity.DrugDiscountCollection, "List<DrugDiscount>|DrugDiscountCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(DrugDiscount child in entity.DrugDiscountCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.DrugDiscountCollection.Count > 0 || entity.DrugDiscountCollection.DeletedItems.Count > 0)
					{
						//DataRepository.DrugDiscountProvider.Save(transactionManager, entity.DrugDiscountCollection);
						
						deepHandles.Add("DrugDiscountCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< DrugDiscount >) DataRepository.DrugDiscountProvider.DeepSave,
							new object[] { transactionManager, entity.DrugDiscountCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<GrnDetails>
				if (CanDeepSave(entity.GrnDetailsCollection, "List<GrnDetails>|GrnDetailsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(GrnDetails child in entity.GrnDetailsCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.GrnDetailsCollection.Count > 0 || entity.GrnDetailsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.GrnDetailsProvider.Save(transactionManager, entity.GrnDetailsCollection);
						
						deepHandles.Add("GrnDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< GrnDetails >) DataRepository.GrnDetailsProvider.DeepSave,
							new object[] { transactionManager, entity.GrnDetailsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<PoDetails>
				if (CanDeepSave(entity.PoDetailsCollection, "List<PoDetails>|PoDetailsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(PoDetails child in entity.PoDetailsCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.PoDetailsCollection.Count > 0 || entity.PoDetailsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.PoDetailsProvider.Save(transactionManager, entity.PoDetailsCollection);
						
						deepHandles.Add("PoDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< PoDetails >) DataRepository.PoDetailsProvider.DeepSave,
							new object[] { transactionManager, entity.PoDetailsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<Stock>
				if (CanDeepSave(entity.StockCollection, "List<Stock>|StockCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(Stock child in entity.StockCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.StockCollection.Count > 0 || entity.StockCollection.DeletedItems.Count > 0)
					{
						//DataRepository.StockProvider.Save(transactionManager, entity.StockCollection);
						
						deepHandles.Add("StockCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< Stock >) DataRepository.StockProvider.DeepSave,
							new object[] { transactionManager, entity.StockCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<StockOutDetails>
				if (CanDeepSave(entity.StockOutDetailsCollection, "List<StockOutDetails>|StockOutDetailsCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(StockOutDetails child in entity.StockOutDetailsCollection)
					{
						if(child.DrugIdSource != null)
						{
							child.DrugId = child.DrugIdSource.DrugId;
						}
						else
						{
							child.DrugId = entity.DrugId;
						}

					}

					if (entity.StockOutDetailsCollection.Count > 0 || entity.StockOutDetailsCollection.DeletedItems.Count > 0)
					{
						//DataRepository.StockOutDetailsProvider.Save(transactionManager, entity.StockOutDetailsCollection);
						
						deepHandles.Add("StockOutDetailsCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< StockOutDetails >) DataRepository.StockOutDetailsProvider.DeepSave,
							new object[] { transactionManager, entity.StockOutDetailsCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region DrugDispoChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>Pharmacy.Entities.DrugDispo</c>
	///</summary>
	public enum DrugDispoChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>Classification</c> at ClassificationIdSource
		///</summary>
		[ChildEntityType(typeof(Classification))]
		Classification,
			
		///<summary>
		/// Composite Property for <c>Group</c> at GroupIdSource
		///</summary>
		[ChildEntityType(typeof(Group))]
		Group,
			
		///<summary>
		/// Composite Property for <c>MarkUpType</c> at MarkUpTypeSource
		///</summary>
		[ChildEntityType(typeof(MarkUpType))]
		MarkUpType,
			
		///<summary>
		/// Composite Property for <c>Shelf</c> at ShelfSource
		///</summary>
		[ChildEntityType(typeof(Shelf))]
		Shelf,
			
		///<summary>
		/// Composite Property for <c>UnitTable</c> at UnitSource
		///</summary>
		[ChildEntityType(typeof(UnitTable))]
		UnitTable,
	
		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for AdjustmentDetailsCollection
		///</summary>
		[ChildEntityType(typeof(TList<AdjustmentDetails>))]
		AdjustmentDetailsCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for RequiredAdjustmentCollection
		///</summary>
		[ChildEntityType(typeof(TList<RequiredAdjustment>))]
		RequiredAdjustmentCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for PrescriptionDetailCollection
		///</summary>
		[ChildEntityType(typeof(TList<PrescriptionDetail>))]
		PrescriptionDetailCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for DrugDiscountCollection
		///</summary>
		[ChildEntityType(typeof(TList<DrugDiscount>))]
		DrugDiscountCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for GrnDetailsCollection
		///</summary>
		[ChildEntityType(typeof(TList<GrnDetails>))]
		GrnDetailsCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for PoDetailsCollection
		///</summary>
		[ChildEntityType(typeof(TList<PoDetails>))]
		PoDetailsCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for StockCollection
		///</summary>
		[ChildEntityType(typeof(TList<Stock>))]
		StockCollection,

		///<summary>
		/// Collection of <c>DrugDispo</c> as OneToMany for StockOutDetailsCollection
		///</summary>
		[ChildEntityType(typeof(TList<StockOutDetails>))]
		StockOutDetailsCollection,
	}
	
	#endregion DrugDispoChildEntityTypes
	
	#region DrugDispoFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;DrugDispoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="DrugDispo"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class DrugDispoFilterBuilder : SqlFilterBuilder<DrugDispoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DrugDispoFilterBuilder class.
		/// </summary>
		public DrugDispoFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the DrugDispoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public DrugDispoFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the DrugDispoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public DrugDispoFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion DrugDispoFilterBuilder
	
	#region DrugDispoParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;DrugDispoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="DrugDispo"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class DrugDispoParameterBuilder : ParameterizedSqlFilterBuilder<DrugDispoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DrugDispoParameterBuilder class.
		/// </summary>
		public DrugDispoParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the DrugDispoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public DrugDispoParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the DrugDispoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public DrugDispoParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion DrugDispoParameterBuilder
	
	#region DrugDispoSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;DrugDispoColumn&gt;"/> class
	/// that is used exclusively with a <see cref="DrugDispo"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class DrugDispoSortBuilder : SqlSortBuilder<DrugDispoColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DrugDispoSqlSortBuilder class.
		/// </summary>
		public DrugDispoSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion DrugDispoSortBuilder
	
} // end namespace
